import { requestToken } from '@/utils/request.js'
import service from '../utils/request'
import { getToken } from "../utils/auth";
// 上传文件接口 /file/uploadSingleFile
export const upload = (data) => {
    const dealData = new FormData()
    dealData.append("token", getToken());
    for (let key in data) {
        dealData.append(key, data[key])
    }
    return service({
        data: dealData,
        method: 'post',
        url: '/file/uploadSingleFile',
        headers: {
            "Content-Type": "multipart/form-data",
        }
    })
}

// 查询仓库列表 /store/queryList
export const stashList = (data) => {
    return requestToken('/store/queryList', data)
}
// 新增仓库列表 /store/saveSingle
export const stashSaveSingle = (data) => {
    return requestToken('/store/saveSingle', data)
}
// 删除仓库列表 /store/deleteSingle
export const stashDeleteSingle = (data) => {
    return requestToken('/store/deleteSingle', data)
}


// 查询车辆列表 /car/queryList
export const carList = (data) => {
    return requestToken('/car/queryList', data)
}
// 新增车辆列表 /car/saveSingle
export const carSaveSingle = (data) => {
    return requestToken('/car/saveSingle', data)
}
// 删除车辆列表 /car/deleteSingle
export const carDeleteSingle = (data) => {
    return requestToken('/car/deleteSingle', data)
}

// 查询安全列表 /secure/queryList
export const secureList = (data) => {
    return requestToken('/secure/queryList', data)
}
// 新增安全列表 /secure/saveSingle
export const secureSaveSingle = (data) => {
    return requestToken('/secure/saveSingle', data)
}
// 删除安全列表 /secure/deleteSingle
export const secureDeleteSingle = (data) => {
    return requestToken('/secure/deleteSingle', data)
}

// 查询票制列表 /vote/queryList
export const voteList = (data) => {
    return requestToken('/vote/queryList', data)
}
// 新增票制列表 /vote/saveSingle
export const voteSaveSingle = (data) => {
    return requestToken('/vote/saveSingle', data)
}
// 删除票制列表 /vote/deleteSingle
export const voteDeleteSingle = (data) => {
    return requestToken('/vote/deleteSingle', data)
}

// 查询考核列表 /examine/queryList
export const examineList = (data) => {
    return requestToken('/examine/queryList', data)
}
// 新增考核列表 /examine/saveSingle
export const examineSaveSingle = (data) => {
    return requestToken('/examine/saveSingle', data)
}
// 删除考核列表 /examine/deleteSingle
export const examineDeleteSingle = (data) => {
    return requestToken('/examine/deleteSingle', data)
}